package com.fliad.ai.controller;

import org.noear.solon.annotation.*;
import org.noear.solon.core.handle.Result;

import java.util.ArrayList;
import java.util.List;

/**
 * 工具提供者控制器
 */
public class ToolController {
    // 扫描包路径
    private static final String PACKAGE_PATH = "com.fliad.ai.tool";

    /**
     * 获取工具列表
     */
    @Get
    @Mapping("/provider")
    public Result<List<ToolInfo>> list() {
        List<ToolInfo> toolList = new ArrayList<>();

        // 扫描包下的所有类作为工具
        toolList.add(new ToolInfo("com.fliad.ai.tool.ToolDemo", "ToolDemo"));

        return Result.succeed(toolList);
    }

    /**
     * 工具信息
     */
    public static class ToolInfo {
        private String id;
        private String name;

        public ToolInfo(String id, String name) {
            this.id = id;
            this.name = name;
        }

        // Getters and setters
        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
